package cn.schoolwow.workflow.test.module.analyzeWorkReport.audit.single.revoke.flow;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import cn.schoolwow.workflow.QuickWorkFlow;
import cn.schoolwow.workflow.entity.WorkFlowInstance;

public class RevokeAnalyzeWorkReportFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        QuickWorkFlow quickWorkFlow = flowContext.checkInstanceData(QuickWorkFlow.class);
        WorkFlowInstance workFlowInstance = flowContext.checkInstanceData(WorkFlowInstance.class);

        //将当前实例状态设置为已撤回
        quickWorkFlow.revokeWorkFlowInstance(workFlowInstance.getId());
    }

    @Override
    public String name() {
        return "分析工作报告-撤回工作流实例";
    }
}
